<%@ include file="/common/taglibs.jsp"%>

<head>
    <title> <fmt:message key="menu.js3"/></title>
    <meta name="heading" content="<fmt:message key='disciplineProcedure.disciplineProcedure'/>" />


    <meta name="menu" content="FormsMenu"/>
</head>

<div class="jquery_tab_container">
    <span class="heading_tab advanced_link active tab1"><fmt:message key="menu.js3"/></span>
</div>

<div class="jquery_tab">
    <div class="content_block"></div>

<form:form class="popupDeleteForm" commandName="disciplineProcedureForm" method="post" action="disciplineprocedureform" id="disciplineProcedureForm" onsubmit="return validateDisciplineProcedureForm(this)">
    <form:errors path="*" cssClass="error" element="div"/>
    <form:hidden path="disciplineProcedure.id"/>
    <p>

        <appfuse:label styleClass="width150 left" key="basicInfo.firstName"/>
        <form:input path="disciplineProcedure.workPosition.employment.firstName" id="disciplineProcedure.workPosition.employment.firstName" disabled="true" style="background-color: #ccc;" cssClass="input-medium left" cssErrorClass="text medium error" maxlength="1000"/>
        <form:errors path="disciplineProcedure.workPosition.employment.firstName" cssClass="fieldError"/>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="basicInfo.lastName"/>
        <form:errors path="disciplineProcedure.workPosition.employment.lastName" cssClass="fieldError"/>
        <form:input path="disciplineProcedure.workPosition.employment.lastName" id="disciplineProcedure.workPosition.employment.lastName" disabled="true" style="background-color: #ccc;" cssClass="input-medium left" cssErrorClass="text medium error" maxlength="50"/>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="basicInfo.socScrNo"/>
        <form:errors path="disciplineProcedure.workPosition.employment.socScrNo" cssClass="fieldError"/>
        <form:input path="disciplineProcedure.workPosition.employment.socScrNo" id="disciplineProcedure.workPosition.employment.socScrNo" disabled="true" style="background-color: #ccc;" cssClass="input-medium left" cssErrorClass="text medium error" maxlength="4096"/>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.position"/>
        <form:errors path="disciplineProcedure.workPosition.position" cssClass="fieldError"/>
        <form:input path="disciplineProcedure.workPosition.position" id="disciplineProcedure.workPosition.position" disabled="true" style="background-color: #ccc;" cssClass="input-medium left" cssErrorClass="text medium error" maxlength="50"/>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.responsibilityType"/>
        <form:select path="disciplineProcedure.respType.id" id="responsibilityTypeSelect">
            <form:option id="1" value="">
                <fmt:message key="respTypeSearch"/>
            </form:option>
            <c:forEach items="${disciplineProcedureForm.responsibilityType}" var="responsibility">

                <c:if test="${responsibility == disciplineProcedureForm.disciplineProcedure.respType}">
                    <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respType.id}" selected="true" >
                        ${responsibility.name}
                    </form:option>
                </c:if>
                <c:if test="${responsibility != disciplineProcedureForm.disciplineProcedure.respType}">
                    <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respType.id}" >
                        ${responsibility.name}
                    </form:option>
                </c:if>
            </c:forEach>
        </form:select>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.responsibilityReason"/>
        <form:select path="disciplineProcedure.respReason.id" id="responsibilityReasonSelect">
            <form:option id="1" value="">
                <fmt:message key="respReasonSearch"/>
            </form:option>
            <c:forEach items="${disciplineProcedureForm.responsibilityReason}" var="responsibility">

                <c:if test="${responsibility == disciplineProcedureForm.disciplineProcedure.respReason}">
                    <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respReason.id}" selected="true" >
                        ${responsibility.name}
                    </form:option>
                </c:if>
                <c:if test="${responsibility != disciplineProcedureForm.disciplineProcedure.respReason}">
                    <form:option value="${responsibility.id}" id="${disciplineProcedureForm.disciplineProcedure.respReason.id}" >
                        ${responsibility.name}
                    </form:option>
                </c:if>
            </c:forEach>
        </form:select>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.measureTaken"/>
        <form:select path="disciplineProcedure.measures.id" id="measuresSelect">
            <form:option id="1" value="">
                <fmt:message key="measuresSearch"/>
            </form:option>
            <c:forEach items="${disciplineProcedureForm.measuresTaken}" var="measures">

                <c:if test="${measures == disciplineProcedureForm.disciplineProcedure.measures}">
                    <form:option value="${measures.id}" id="${disciplineProcedureForm.disciplineProcedure.measures.id}" selected="true" >
                        ${measures.name}
                    </form:option>
                </c:if>
                <c:if test="${measures != disciplineProcedureForm.disciplineProcedure.measures}">
                    <form:option value="${measures.id}" id="${disciplineProcedureForm.disciplineProcedure.measures.id}" >
                        ${measures.name}
                    </form:option>
                </c:if>
            </c:forEach>
        </form:select>

        <br class="clearer" />
        </p>

        <p>
        <appfuse:label styleClass="width150 left" key="disciplineProcedure.procDate"/>
        <form:input  path="disciplineProcedure.procDate"  cssClass="input-medium flexy_datepicker_input" id="basicInfo.birthDate"
                     value="" name="flexy_datepicker" cssErrorClass="text medium error"/>
        <form:errors path="disciplineProcedure.procDate" cssClass="fieldError"/>

        <br class="clearer" />
        </p>

       
    <form:hidden id="reasonDelete" path="savedReason.id"/>
    <p class="buttonBar bottom">
        <input type="submit" class="button" name="save" value="<fmt:message key="button.save"/>"/>
     
        <c:if test="${not empty disciplineProcedureForm.disciplineProcedure.id}">
        <input type="button" class="button" onclick="confirmDelete();"
            value="<fmt:message key="button.delete"/>" />
        </c:if>
        <%--<input type="submit" class="button" name="cancel" value="<fmt:message key="button.cancel"/>" onclick="bCancel=true"/>--%>

        <input
            type="button"
            class="button"
            name="cancel"
            value="<fmt:message key="button.cancel"/>"
             onclick="location.href='<c:url value="/searchDisciplineProcedures"/>'"
            />
    </p>

    
</form:form>


<v:javascript formName="disciplineProcedureForm" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<c:url value='/scripts/validator.jsp'/>"></script>
<script type="text/javascript">
    Form.focusFirstElement($('disciplineProcedureForm'));
</script>


<div id="confirmdelete">
    <fmt:message key="delete.reasonDescription" />
    <select id="deleteReasonId">
        <c:forEach items="${disciplineProcedureForm.deleteReason}" var="reason">
             <option value="${reason.id}">
                ${reason.name}
             </option>
        </c:forEach>
    </select>
</div>

</div>